#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

int main(){
    pid_t pid = fork();
    pid_t pid1 = fork();

    if (pid == 0) {
        sleep(3);
        printf("I am son(%d)\n", getpid());
    } else {
        printf("I am father(%d)\n", getpid());

        waitpid(pid, NULL, WNOHANG);
        waitpid(pid1, NULL, WNOHANG);
        
        printf("I am father and I am done.\n");

    }
}
